package myWork;

import java.util.Arrays;

public class StringtoInt {
    public static void main(String[] args) {
        String s = "91 27 46 38 50";
        String[] strings = s.split(" ");

        int[] arr = new int[strings.length];
        for (int i = 0; i < strings.length; i++) {
            arr[i] = Integer.parseInt(strings[i]);
        }
        int max = 0;
        for (int i = 0; i < arr.length; i++) {
            int a = arr[i];
            if (a>max){
                max = a;
                Arrays.sort(arr);
                break;
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}